<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var id = 1;
        let name = 'zs';
        const age = 20;
        // let obj = {
        //     id: id,
        //     name: name,
        //     age: age,
        // }
        let obj = {
            id,
            name,
            age,
            fn() {
                console.log(this.id);
            }
        }
        console.log(obj);
        obj.fn();
    </script>
</body>

</html>